﻿using LearnMAUI2.Models;
using System.Globalization;

namespace LearnMAUI2.Converters;

//用于将ItemTappedEvent事件对应的参数转换为Poetry传递
public class EventArgsToPoetryConverter : IValueConverter
{
    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
       return (value as ItemTappedEventArgs)?.Item as Poetry;
    }

    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
